package com.shop.entity;

import java.util.HashSet;
import java.util.Set;
/*CREATE TABLE merchantorder (
   `id` BIGINT(16) NOT NULL auto_increment PRIMARY KEY,
   `deliveryState` TINYINT(1),
   `progressState` TINYINT(1),
   `totalAmount` DOUBLE NULL,
   `order_id` BIGINT(16),
   `merchant_id` BIGINT(16),
   foreign key (`order_id`) references ordertb(`id`),
   foreign key (`merchant_id`) references merchant(`id`) 
)ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;*/
/**
 * 
 * <b>商户订单表<b>
 * @author 威 
 * <br>2018年1月2日 下午2:46:52
 *
 */
public class MerchantOrder {
	private Integer id ;
	private boolean deliveryState ;	//是否发货
	private boolean progressState ;	//是否完成订单
	private Double totalAmount ; 	//商店的金额小结
	private Order order ; 							//订单表外键 		n:1
	private Set<OrderGoodsList> orderGoodsLists = new HashSet<OrderGoodsList>() ; 	//关联表订单商品清单表 1:n
	private OrderLogistics logistics ; 				//关联表			1:1     双向关联
	private Merchant merchant ;						//商户外键			n:1	
	private String time ;
	
	
	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public boolean isDeliveryState() {
		return deliveryState;
	}


	public void setDeliveryState(boolean deliveryState) {
		this.deliveryState = deliveryState;
	}


	public boolean isProgressState() {
		return progressState;
	}


	public void setProgressState(boolean progressState) {
		this.progressState = progressState;
	}


	public Double getTotalAmount() {
		return totalAmount;
	}


	public void setTotalAmount(Double totalAmount) {
		this.totalAmount = totalAmount;
	}


	public Order getOrder() {
		return order;
	}


	public void setOrder(Order order) {
		this.order = order;
	}


	public Set<OrderGoodsList> getOrderGoodsLists() {
		return orderGoodsLists;
	}


	public void setOrderGoodsLists(Set<OrderGoodsList> orderGoodsLists) {
		this.orderGoodsLists = orderGoodsLists;
	}


	public OrderLogistics getLogistics() {
		return logistics;
	}


	public void setLogistics(OrderLogistics logistics) {
		this.logistics = logistics;
	}


	public Merchant getMerchant() {
		return merchant;
	}


	public void setMerchant(Merchant merchant) {
		this.merchant = merchant;
	}


	public String getTime() {
		return time;
	}


	public void setTime(String time) {
		this.time = time;
	}


	public String toString(){
		return "MerchantOrder[id="+id+
				",deliveryState="+deliveryState+
				",progressState="+progressState+
				",totalAmount="+totalAmount+
				",orderId="+order.getId()+
				",orderGoodsListsSize="+orderGoodsLists.size()+
				",logisticsId="+logistics.getId()+
				",merchantId="+merchant.getId()+
				",time="+time+
				"]" ;
	}
}
